// app.js
App({
  onLaunch() {
    let screenWidth = wx.getSystemInfoSync().screenWidth
    let custom = wx.getMenuButtonBoundingClientRect()
    wx.setStorageSync('screenWidth', screenWidth)
    wx.setStorageSync('customTop', custom.top)
    wx.setStorageSync('customRight', custom.right)
    wx.setStorageSync('customLeft', custom.left)
    wx.setStorageSync('customHeight', custom.height)
    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
		})
		wx.setKeepScreenOn({ keepScreenOn: true })
  },
  globalData: {
    userInfo: null
  }
})